import React from 'react'
import { Keyboard, StyleSheet } from 'react-native'
import { px2dp } from 'rn-xiaobu-utils'
import TextButton from '../../../widgets/TextButton'

export default class LoginBtn extends React.Component {

  _buttonPress = () => {
    Keyboard.dismiss()
    this.props.onPress()
  }

  render() {
    return (
      <TextButton text={this.props.text} onPress={this._buttonPress}
        style={styles.loginText}
        touchStyle={styles.btnTouchStyle}>
      </TextButton>
    )
  }
}

const styles = StyleSheet.create({
  loginText: {
    color: '#ffffff',
    fontSize: px2dp(28)
  },
  btnTouchStyle: {
    width: px2dp(690),
    height: px2dp(80),
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#28acff',
    marginTop: px2dp(102),
    borderRadius: px2dp(8)
  }
})